<!--
@Description:已读日志
@Author:zqy
@Date:2024-10-22 19:54:02
@Last Modified by:zqy
@Last Modified time:2024-10-22 19:54:02
-->
<template>
  <el-dialog
    v-dialogDrag="true"
    title="已读明细"
    :visible.sync="dialogShow"
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    width="800px"
    append-to-body
    @close="closeDialog"
  >
    <table-box
      ref="refTable"
      table-size="small"
      :table-config="tableConfig"
      :other-filters="otherFilters"
      :table-height="450"
      :table-sortable="false"
      show-index
      :show-custom-setting="true"
      :show-custom-collect="false"
      :show-custom-combine="false"
      :setting-auto-request="false"
    />
  </el-dialog>
</template>

<script>
import { parseTime } from '@/utils'
export default {
  name: 'IndexPageTipRedLog',
  props: {
    visible: {
      type: Boolean,
      default: false,
      required: true
    },
    sourceId: {
      type: String,
      default: ''
    }
  },
  data() {
    const that = this
    return {
      otherFilters: [
        { id: 'readState', property: 'readState', operator: '=', value: 1 },
        { id: 'indexPageTipId', property: 'indexPageTipId', operator: '=', value: that.sourceId }
      ], // 表格额外查询条件
      otherRaws: {},
      tableConfig: {
        interfacePath: `${process.env.VUE_APP_BASE_API}/api/v1/indexPageTipUserRead/page`,
        // hideFuncBar: true,
        onlySearchBar: false,
        tabIndex: 1,
        buttonGroupCode: 'log',
        pageSize: 10,
        sort: 'createTime',
        order: 'desc',
        setting: [
          {
            prop: 'clientCode',
            label: '来源',
            width: 150,
            type: 'select',
            propEnum: {
              list: [
                { dictCode: 'SAD-APP', dictName: '销售宝APP' },
                { dictCode: 'SAD-PAD', dictName: '销售宝PAD' },
                { dictCode: 'SAD-PC', dictName: '销售宝PC' }
              ]
            }
          },
          {
            prop: 'userName',
            label: '用户名',
            minWidth: 150
          },
          {
            prop: 'trueName',
            label: '姓名',
            minWidth: 150
          },
          {
            prop: 'createTime',
            label: '操作时间',
            width: 150,
            formatData: ({ createTime }) => {
              return parseTime(createTime)
            }
          }
        ],
        btnList: []
      }
    }
  },
  computed: {
    dialogShow: {
      get() {
        return this.visible
      },
      set(val) {
        this.$emit('update:visible', val)
      }
    }
  },
  created() {

  },
  methods: {
    closeDialog() {
      this.dialogShow = false
    }
  }
}

</script>
<style lang='scss' scoped>
</style>
